import 'package:flutter/material.dart';
import 'package:get/get.dart';

void main() {
  runApp(GetMaterialApp(
    home: Home(),
  ));
}

class Home extends StatelessWidget {
  // const Home({super.key});

  var times = 0.obs;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text("这是一个标题")),
      body: Center(
        child: Obx(() => Text(times.toString())),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () {
          times++;
          Get.snackbar("你好", "测试");
        },
        child: Icon(Icons.add),
      ),
    );
  }
}
